//
//  SIPInterface.h
//  SIP
//
//  Created by wrt on 13-9-29.
//  Copyright (c) 2013年 wrt. All rights reserved.
//

#import <Foundation/Foundation.h>

//代理的回调方法
@protocol SIPInterfaceListenDelegate <NSObject>

@required

@optional
- (void)registerSuccessful;//注册成功
- (void)registerFailed;    //注册失败
- (void)outgoingCallBegin; //主动呼叫开始
- (void)incomingCallBegin; //收到一路呼叫
- (void)callEnding;        //呼叫结束
- (void)callAnswer;        //被叫自己摘机或者主叫对方摘机
- (void)openWindow;        //视频窗口开始刷新
- (void)changeStatus:(NSString *)statusStr;  //状态信息

@end
//---------

@interface SIPInterface : NSObject
{
    id <SIPInterfaceListenDelegate> delegate;   //代理的名称
}
@property (nonatomic, weak) id<SIPInterfaceListenDelegate> delegate; //代理的属性
@property (nonatomic, assign) int callID;   //拨出去的ID
@property (nonatomic, assign) int incomingID;   //来电的ID
@property (nonatomic, strong) NSString *incomingNumber;  //来电的号码
@property (nonatomic, strong) NSString *incomingDisplayName;  //来电的昵称
@property (nonatomic, strong) NSString *incomingTime;    //来电的时间

@property (nonatomic, strong) NSString *reloadView;  //用于KVO设置刷新屏幕的

//Sip初始化方法
+ (SIPInterface *)shareSIPInterface;

//开始启动
- (void)startSip;
//设置回调函数
- (void)my_callerback;
//设置设备和版本号
- (void)setDeviceName:(NSString *)deviceName andVersionNumber:(NSString *)versionStr;
//设置用户
-(void)register:(NSString *)UserName passWord:(NSString *)PassWord;
//设置昵称
- (void)displayName:(NSString *)nick andUserName:(NSString *)username;
//注册服务器地址
- (void)setServiceAddress:(NSString *)serviceIp andPort:(int)port;
//启动注册
- (void)startRegisterUsers;
//关闭注册
- (void)closeRegisterUsers;
//开始主动呼叫
- (void)start_Call:(NSString *)phone;
//开始直接呼叫
- (void)directStartCall:(NSString *)phone andIP:(NSString *)serviceIp andPort:(NSString *)port;
//接听
- (void)answer_call;
//对方视频窗口设置
- (void)setWindownId:(UIView *)view;
//本身视频窗口设置
- (void)setPreviousWindowId:(UIView *)view;
//挂断
- (void)hang_call;     //挂拨出去的电话
- (void)hang_incoming; //挂接听的电话
//开锁
- (void)unlock;
//去电开锁
- (void)callunlock;
//关闭视频
- (void)closeSip;
//去电铃声
- (void)outCallRing:(NSString *)path;
//来电铃声
- (void)incomingRing:(NSString *)path;
//前置摄像头
- (void)FonrtDevice:(int)a;
//视频大小通过与设定名称
- (void)videoSize:(NSString *)name;
//设置视频的上下带宽
- (void)setVideoWidth;
//是否打开视频预览
- (void)isOpenSelfVideo:(BOOL)a;
//是否打开视频
- (void)isOpenVideo:(BOOL)a;
//是否打开音频
- (void)isOpenSound:(BOOL)a;
//测试回音
- (void)testSound;
//视频的传输协议
- (void)setVideotransport:(int)transport;
//设置stun服务器
- (void)setStunServer:(NSString *)ip;
//设置SIP协议使用端口
- (void)setSIPport:(NSString *)port;
//设置视频RTP接口端口
- (void)setRTPvideoPort:(NSString *)port;
//设置音频RTP接口端口
- (void)setRTPsoundPort:(NSString *)port;
//设置音视频的上传带宽
- (void)setSoundAndVideoUpWidth:(NSString *)width;
//设置音视频的下载带宽
- (void)setSoundAndVideoDownWidth:(NSString *)width;
//设置是否打开日志
- (void)isOpenNote:(BOOL)a;
//设置是否打开留言
- (void)isOpenMsg:(BOOL)a;
//是否打开自动接听
- (void)isOpenAutoAnswer:(BOOL)a;
//设置自动应答码
- (void)autoAnswerCallNumber:(NSString *)number;
////添加好友
//- (void)addFriendsWithUserName:(NSString *)userName andDisPlayName:(NSString *)disPlayName andIp:(NSString *)ip;
//改变自己的状态
- (void)setMyStatusWithInt:(int)stauts;
////同意添加好友
//- (void)acceptAddFriendWithUserName:(NSString *)userName andDisPlayName:(NSString *)disPlayName andIp:(NSString *)ip;
////拒绝添加好友
//- (void)rejectAddFriendWithUserName:(NSString *)userName andDisPlayName:(NSString *)disPlayName andIp:(NSString *)ip;
////删除好友
//- (void)deleteFriendWithUserName:(NSString *)userName andDisPlayName:(NSString *)disPlayName andIp:(NSString *)ip;
//主动创建窗口
- (void)creatChatRoomWithUserName:(NSString *)userName;
//销毁聊天窗口
- (void)destoryChatRoom;
//查寻即时消息传递过来的内容
- (NSArray *)getChatRoomPeerUserName:(unsigned long)windowId;
//发送消息
- (void)sendMessageWithUrl:(NSString *)url andOnedata:(int)onedata andTextContent:(NSString *)text;
//根据用户名获取windowID
- (unsigned long)getChatRoomByUserName:(NSString *)name andIPport:(NSString *)ip andPort:(NSString *)port;
//进入后台模式
- (void)enterBackground;
//接收包
- (void)iterator;
//设置报警服务器地址
- (void)setAlarmIPAddressAndPort:(NSString *)address andPort:(NSString *)port;
//设置布防或者是撤防
- (void)setAlarmControlArmingOrDisarming:(int)a;
//获取音频编解码接口数量
- (int)getAudioCodeCount;
//获取视频编解码接口数量
- (int)getVideoCodeCount;
//获取音频编解码串号
- (unsigned long)getAudioCodeNumber:(int)index;
//获取视频编解码串号
- (unsigned long)getVideocodeNumber:(int)index;
//获取音视频解码的名称
- (NSString *)getAudioAndVideoName:(unsigned long)typeNumber;
//调整音视频解码的开关
- (void)setEnabledAudioAndVideo:(unsigned long)typeNumber andOn:(int)onOrOff;
//调整音视频解码的位置
- (void)setAudioAndVideoMove:(unsigned long)typeNumber andDir:(int)dir;
//获取通话状态信息
- (void)getCallStatusDetail;


@end
